package com.dhu.stylefit.controller;

import com.dhu.stylefit.Response;
import com.dhu.stylefit.service.ClothesOneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/api/style")
public class StyleAnalyzeController {
    
    @Autowired
    private ClothesOneService clothesOneService;
    
    @PostMapping("/analyze")
    public Response analyzeStyle(@RequestBody String userRequest) {
        try {
            Map<String, Object> result = clothesOneService.analyzeStyle(userRequest);
            return Response.newSuccess(result);
        } catch (Exception e) {
            return Response.newFail("分析失败：" + e.getMessage());
        }
    }
} 